package poo;

import java.util.ArrayList;
import java.util.List;

public class App {

	// pour le code final
	public static void main(String[] args) {

		Fruit[] fruits = new Fruit[3];
		fruits[0] = new Pomme(50);
		fruits[1] = new Orange(60);
		fruits[2] = new Pomme(90);
		System.out.println("----------------------------------------");
		
		for (Fruit fruit : fruits) {
			fruit.affiche();
			fruit.affichePoids();
			System.out.println("----------------------------------------");
		}
		System.out.println();
		
		List<Fruit> fruits2 = new ArrayList<Fruit>();
		fruits2.add(new Pomme(60));
		fruits2.add(new Orange(90));
		fruits2.add(new Pomme(90));	
		System.out.println();
		for (Fruit fruit : fruits2) {
			fruit.affiche();
			fruit.affichePoids();
			System.out.println("----------------------------------------");
		}
	}
}
